var express = require('express');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');

var app = express();
app.listen(8080);
app.use(express.static(__dirname + 'public'));

app.use('/', indexRouter);
app.use('/users', usersRouter);

app.use((err,req,res,next) => {
	console.log(err);
	res.send({code:500,msg:'服务器错误'});
});










module.exports = app;